// 父组件
import React, { useState } from 'react';
import ChildComponent from './chilren';

function ParentComponent() {
    const [data, setData] = useState("");

    const handleChildData = (childData) => {
        setData(childData);
    };


    const datass = "我恁跌";
    return <>
        <p>我是父组件</p>
        <p>Data from child: {data} </p>
        <ChildComponent data={datass} sendDataToParent={handleChildData} />
    </>;
}


export default ParentComponent;